home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / amiexpress / utils / conacp3.00 / conacp.c < prev    next >
C/C++ Source or Header  |  1992-12-26  |  22KB  |  721 lines

  1.  
  2. #include <exec/types.h>
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <workbench/workbench.h>
  6. #include <dos/dosextens.h>
  7. #include <clib/dos_protos.h>
  8. #include <clib/exec_protos.h>
  9. #include <clib/icon_protos.h>
  10.  
  11. struct Library *IconBase;
  12. struct PSTR
  13. {
  14.   int s1;
  15.   int s2;
  16.   int ns;
  17.   int ne;
  18. };
  19.  
  20. void ReadStartUp(void);
  21. int CheckConfigNode(char str[],FILE *fo);
  22. int ParseImage(char *str,struct PSTR *p);
  23. void sr(char *str);
  24. void strleft(char *str,char *str1);
  25. void MakeIcons(void);
  26. void MakeModuleIcons(void);
  27. int atoileft(char str[]);
  28. void GetStr(char *d,char *s,int num);
  29. void CreateConfs(void);
  30. void MakeAreaIcons(void);
  31. void ConvertUserData(void);
  32. #define CMDLOOP for(i=p.ns;i<=p.ne;i++)
  33. main()
  34.    char image[200];
  35.    char string[200];
  36.    FILE *fi;
  37.    fi=fopen("S:ACP.Startup","r");
  38.    if(fi==NULL)
  39.    {
  40.      printf("Error, can't locate s:acp.startup\n");
  41.      exit(0);
  42.    }
  43.    fclose(fi);
  44.    fi=fopen("BBS:User.Data","r");
  45.    if(fi==NULL)
  46.    {
  47.      printf("Error, can't locate BBS:User.Data\n");
  48.      exit(0);
  49.    }
  50.    fclose(fi);
  51.  
  52.    IconBase=OpenLibrary("icon.library",0L);
  53.    printf("Reading ACP.STARTUP\n");
  54.    printf("Scanning User.Data\n");
  55.    Execute("AE3.0_Disk1:Utils/ConvertDB BBS:User.Data",NULL,NULL);
  56.    printf("Sorting User.Data Conference Accesses\n");
  57.    Execute("Sort BBS:User.Data.Lst to RAM:AreaList",NULL,NULL);
  58.    printf("Stripping Conference Access Duplicates\n");
  59.    Execute("AE3.0_Disk1:Utils/StripDupe RAM:AreaList",NULL,NULL);
  60.    ConvertUserData();
  61.      printf("Building Icon Definition File\n");
  62.  
  63.    ReadStartUp();
  64.    printf("Renaming BBS:Fcheck to BBS:Fcheck.old\n");
  65.    Rename("BBS:Fcheck","BBS:Fcheck.old");
  66.    printf("Renaming BBS:Commands to BBS:Commands.old\n");
  67.    Rename("BBS:Commands","BBS:Commands.old");
  68.    printf("Copying New Commands & Fcheck Drawers to BBS:\n");
  69.    Execute("Copy >NIL: AE3.0_DISK2:BBS/Fcheck#? to BBS: all",NULL,NULL);
  70.    Execute("Copy >NIL: AE3.0_Disk2:BBS/Commands#? to BBS: all",NULL,NULL);
  71.    printf("Copying ScreenTypes to BBS:\n");
  72.    Execute("Copy >NIL: AE3.0_Disk2:BBS/Screentypes.info to BBS:",NULL,NULL);
  73.    printf("Copying Express 3.0 to BBS:\n");
  74.    Execute("Copy >NIL: AE3.0_Disk2:BBS/Express#? to BBS:",NULL,NULL);
  75.    printf("Copying Access Drawer to BBS:\n");
  76.    Execute("Copy >NIL: AE3.0_Disk2:BBS/Access#? to BBS: ALL",NULL,NULL);
  77.    printf("Creating ICON definitions for BBSCmds\n");
  78.     
  79.     MakeModuleIcons();
  80.     MakeAreaIcons();
  81.    sprintf(image,"sort ram:acp.convert to ram:acp.srt");
  82.    Execute(image,NULL,NULL);
  83.  
  84.   printf("Making Icons\n");
  85.  
  86.    MakeIcons();
  87.    CreateConfs();
  88.    CloseLibrary(IconBase);
  89.    exit(0);
  90. }
  91.  
  92. void ConvertUserData(void)
  93. {
  94.    FILE *fi,*fo;
  95.    int i;
  96.    char image[100];
  97.    DeleteFile("RAM:AreaList.Old");
  98.    Rename("RAM:AreaList","RAM:AreaList.old");
  99.    fi=fopen("RAM:AreaList.old","r");
  100.    fo=fopen("RAM:AreaList","w");
  101.    i=0;
  102.    while(fgets(image,90,fi)!=NULL)
  103.    {
  104.      sr(image);
  105.      i++;
  106.      fprintf(fo,"%s %d\n",image,i);
  107.    }
  108.    fclose(fi);
  109.    fclose(fo);
  110.    
  111.    Execute("AE3.0_Disk1:Utils/ConvertDB BBS:User.Data RAM:AreaList",NULL,NULL);
  112.    Execute("Copy BBS:User.Data.New to BBS:User.Data",NULL,NULL);
  113.    Execute("AE3.0_Disk1:Utils/StripUser BBS:User.Data",NULL,NULL);
  114.    Execute("Copy BBS:User.Data.New to BBS:User.Data",NULL,NULL);
  115.  
  116. }
  117. int nodes;
  118. void MakeModuleIcons(void)
  119. {
  120.    FILE *fi,*fo;
  121.    char image[200];
  122.    char doorcommand[200];
  123.    char acs[200];
  124.    char type[200];
  125.    char MultiNode[200];
  126.    char location[200];
  127.    BPTR lock;
  128.    int error;
  129.    int j;
  130.    fi=fopen("BBS:Commands.old/BBS.CMD","r");
  131.    if(fi!=NULL)
  132.    {
  133.      printf("Converting BBS Modules\n");
  134.      fo=fopen("RAM:ACP.Convert","a");
  135.      while(fgets(image,80,fi)!=NULL)
  136.      {
  137.        error=0;
  138.        sr(image);
  139.        strcpy(doorcommand,image);
  140.        doorcommand[10]='\0'; sr(doorcommand);
  141.        switch(image[10])
  142.        {
  143.          case 'X': strcpy(type,"TYPE=XIM"); break;
  144.          case 'P': strcpy(type,"TYPE=TIM"); break;
  145.          case 'R': strcpy(type,"TYPE=AIM"); break;
  146.          default: error=1; 
  147.        }
  148.        switch(image[11])
  149.        {
  150.          case 'S': strcpy(MultiNode,"MULTINODE=NO"); break;
  151.          case 'M': strcpy(MultiNode,"MULTINODE=YES"); break;
  152.           default: error=1;
  153.        }
  154.        sprintf(acs,"%3.3s",&image[12]);
  155.        strcpy(location,&image[15]);
  156.        if(!error)
  157.        {
  158.          printf("\tModule: %s Converted\n",doorcommand);
  159.          fprintf(fo,"MODULE.DEF P BBS:Commands/BBSCmd/%s LOCATION=%s\n",doorcommand,location);
  160.          fprintf(fo,"MODULE.DEF P BBS:Commands/BBSCmd/%s %s\n",doorcommand,type);
  161.          fprintf(fo,"MODULE.DEF P BBS:Commands/BBSCmd/%s %s\n",doorcommand,MultiNode);
  162.          fprintf(fo,"MODULE.DEF P BBS:Commands/BBSCmd/%s ACCESS=%s\n",doorcommand,acs);
  163.          fprintf(fo,"MODULE.DEF P BBS:Commands/BBSCmd/%s STACK=50000\n",doorcommand);
  164.          fprintf(fo,"MODULE.DEF P BBS:Commands/BBSCmd/%s PRIORITY=0\n",doorcommand);
  165.        }
  166.        else
  167.         printf("Error creating %s Module\n",doorcommand);
  168.  
  169.     }
  170.     fclose(fo);
  171.     fclose(fi);
  172.    }
  173. fi=fopen("BBS:Commands.old/Sys.CMD","r");
  174.    if(fi!=NULL)
  175.    {
  176.      printf("Converting System Modules\n");
  177.      fo=fopen("RAM:ACP.Convert","a");
  178.      while(fgets(image,80,fi)!=NULL)
  179.      {
  180.        error=0;
  181.        sr(image);
  182.        strcpy(doorcommand,image);
  183.        doorcommand[10]='\0'; sr(doorcommand);
  184.        switch(image[10])
  185.        {
  186.          case 'X': strcpy(type,"TYPE=XIM"); break;
  187.          case 'P': strcpy(type,"TYPE=TIM"); break;
  188.          case 'R': strcpy(type,"TYPE=AIM"); break;
  189.          default: error=1; 
  190.        }
  191.        switch(image[11])
  192.        {
  193.          case 'S': strcpy(MultiNode,"MULTINODE=NO"); break;
  194.          case 'M': strcpy(MultiNode,"MULTINODE=YES"); break;
  195.           default: error=1;
  196.        }
  197.        sprintf(acs,"%3.3s",&image[12]);
  198.        strcpy(location,&image[15]);
  199.        if(!error)
  200.        {
  201.          printf("\tModule: %s Converted\n",doorcommand);
  202.          fprintf(fo,"MODULE.DEF P BBS:Commands/SysCmd/%s LOCATION=%s\n",doorcommand,location);
  203.          fprintf(fo,"MODULE.DEF P BBS:Commands/SysCmd/%s %s\n",doorcommand,type);
  204.          fprintf(fo,"MODULE.DEF P BBS:Commands/SysCmd/%s %s\n",doorcommand,MultiNode);
  205.          fprintf(fo,"MODULE.DEF P BBS:Commands/SysCmd/%s ACCESS=%s\n",doorcommand,acs);
  206.          fprintf(fo,"MODULE.DEF P BBS:Commands/SysCmd/%s STACK=50000\n",doorcommand);
  207.          fprintf(fo,"MODULE.DEF P BBS:Commands/SysCmd/%s PRIORITY=0\n",doorcommand);
  208.        }
  209.        else
  210.         printf("Error creating %s Module\n",doorcommand);
  211.  
  212.     }
  213.     fclose(fo);
  214.     fclose(fi);
  215.    }
  216.    for(j=1;j<10;j++)
  217.    {
  218.      sprintf(image,"BBS:Commands.old/Conf%d.Cmd",j);
  219. fi=fopen(image,"r");
  220.    if(fi!=NULL)
  221.    {
  222.      sprintf(image,"BBS:Commands/Conf%dCmd",j);
  223.      
  224.      printf("Converting Conference %d Modules\n",j);
  225.      fo=fopen("RAM:ACP.Convert","a");
  226.      if(lock=CreateDir(image))
  227.      {
  228.        printf("Creating %s Directory\n",image);
  229.        UnLock(lock);
  230.        sprintf(image,"DRAWER D BBS:Commands/Conf%dCmd CONF%d.MODULES\n",j,j);
  231.        fprintf(fo,"%s",image);
  232.      }
  233.      while(fgets(image,80,fi)!=NULL)
  234.      {
  235.        error=0;
  236.        sr(image);
  237.        strcpy(doorcommand,image);
  238.        doorcommand[10]='\0'; sr(doorcommand);
  239.        switch(image[10])
  240.        {
  241.          case 'X': strcpy(type,"TYPE=XIM"); break;
  242.          case 'P': strcpy(type,"TYPE=TIM"); break;
  243.          case 'R': strcpy(type,"TYPE=AIM"); break;
  244.          default: error=1; 
  245.        }
  246.        switch(image[11])
  247.        {
  248.          case 'S': strcpy(MultiNode,"MULTINODE=NO"); break;
  249.          case 'M': strcpy(MultiNode,"MULTINODE=YES"); break;
  250.           default: error=1;
  251.        }
  252.        sprintf(acs,"%3.3s",&image[12]);
  253.        strcpy(location,&image[15]);
  254.        if(!error)
  255.        {
  256.          printf("\tModule: %s Converted\n",doorcommand);
  257.          fprintf(fo,"MODULE.DEF P BBS:Commands/Conf%dCmd/%s LOCATION=%s\n",j,doorcommand,location);
  258.          fprintf(fo,"MODULE.DEF P BBS:Commands/Conf%dCmd/%s %s\n",j,doorcommand,type);
  259.          fprintf(fo,"MODULE.DEF P BBS:Commands/Conf%dCmd/%s %s\n",j,doorcommand,MultiNode);
  260.          fprintf(fo,"MODULE.DEF P BBS:Commands/Conf%dCmd/%s ACCESS=%s\n",j,doorcommand,acs);
  261.          fprintf(fo,"MODULE.DEF P BBS:Commands/Conf%dCmd/%s STACK=50000\n",j,doorcommand);
  262.          fprintf(fo,"MODULE.DEF P BBS:Commands/Conf%dCmd/%s PRIORITY=0\n",j,doorcommand);
  263.        }
  264.        else
  265.         printf("Error creating %s Module\n",doorcommand);
  266.  
  267.     }
  268.     fclose(fo);
  269.     fclose(fi);
  270.    }
  271.   }
  272. }
  273. void MakeAreaIcons(void)
  274. {
  275.    FILE *fi,*fo;
  276.    char image[200];
  277.     int i;
  278.    int error;
  279.    fi=fopen("RAM:AreaList","r");
  280.    if(fi!=NULL)
  281.    {
  282.      fo=fopen("RAM:ACP.Convert","a");
  283.      while(fgets(image,80,fi)!=NULL)
  284.      {
  285.  
  286.        sr(image);
  287.        i=1; while(i<10)
  288.        {
  289.          if(image[i-1]=='X')
  290.        fprintf(fo,"AREA.DEF P BBS:ACCESS/AREA.%s CONF.%d\n",&image[11],i);
  291.          i++;
  292.        }
  293.     }
  294.     fclose(fo);
  295.     fclose(fi);
  296.    }
  297. }
  298.  
  299. void CreateConfs(void)
  300. {
  301.   FILE *fo,*fi;
  302.   struct DiskObject *dobj;
  303.   char **tooltypes;
  304.   char *s;
  305.   char temp[200];
  306.   char location[200];
  307.   int i=1;
  308.   int j;
  309.   strcpy(temp,"BBS:ConfConfig");
  310.   dobj=GetDiskObject(temp);
  311.   if(dobj)
  312.   {
  313.     tooltypes=dobj->do_ToolTypes;
  314.     sprintf(temp,"LOCATION.%d",i++);
  315.     while(s=FindToolType(tooltypes,temp))
  316.     {
  317.  
  318.        fo=fopen("ram:temp","w");
  319.        strcpy(location,s);
  320.        sprintf(temp,"%sFREEDOWNLOADS");
  321.        if(!access(temp,00))
  322.        {
  323.          fprintf(fo,"FREEDOWNLOADS\n");
  324.        }
  325.        sprintf(temp,"%sPaths",location);
  326.        if(!access(temp,00))
  327.        {
  328.          fi=fopen(temp,"r");
  329.          j=1;
  330.          while(fgets(temp,80,fi)!=NULL)
  331.          {
  332.            sr(temp);
  333.            fprintf(fo,"DLPATH.%d=%s\n",j++,temp);
  334.          }
  335.          fclose(fi);
  336.        }
  337.        j=1;
  338.        sprintf(temp,"%sULPaths",location);
  339.        fprintf(fo,"ULPATH.%d=%sUpload/\n",j++,location);
  340.        if(!access(temp,00))
  341.        {
  342.           fi=fopen(temp,"r");
  343.           while(fgets(temp,80,fi)!=NULL)
  344.           {
  345.             sr(temp);
  346.             fprintf(fo,"ULPATH.%d=%s\n",j++,temp);
  347.           }
  348.           fclose(fi);
  349.        }
  350.        sprintf(temp,"%sNDIRS",location);
  351.        if(!access(temp,00))
  352.        {
  353.           fi=fopen(temp,"r");
  354.           fgets(temp,80,fi);
  355.           sr(temp);
  356.           fprintf(fo,"NDIRS=%s\n",temp);
  357.        }
  358.        printf("Converting MsgBase for %s\n",location);
  359.        sprintf(temp,"AE3.0_Disk1:Utils/ConVMsg %sMsgBase/HeaderFile",location);
  360.        Execute(temp,NULL,NULL);
  361.        if(location[strlen(location)-1]=='/') location[strlen(location)-1]='\0';
  362.        sprintf(temp,"AE3.0_Disk1:Utils/NewObj AE3.0_Disk1:Storage/Icons/Drawer.info %s.info DRAWER RAM:Temp",location);
  363.        fclose(fo);
  364.        Execute(temp,NULL,NULL);
  365.        sprintf(temp,"Copy AE3.0_Disk1:Storage/NewConf/Conf.DB#? to %s ALL",location);
  366.        Execute(temp,NULL,NULL);
  367.  
  368.        sprintf(temp,"LOCATION.%d",i++);
  369.      }
  370.      FreeDiskObject(dobj);
  371.    }
  372.    strcpy(temp,"BBS:Ami_Drives");
  373.    if(!access(temp,00))
  374.    {
  375.      fo=fopen("ram:temp","w");
  376.      fi=fopen(temp,"r");
  377.      j=1;
  378.      while(fgets(temp,80,fi)!=NULL)
  379.      {
  380.        sr(temp);
  381.        fprintf(fo,"DRIVE.%d=%s\n",j++,temp);
  382.      }
  383.      fclose(fi);
  384.       fclose(fo);
  385.      strcpy(temp,"AE3.0_Disk1:Utils/NewObj AE3.0_Disk1:Storage/Icons/DRIVES.DEF.info BBS:DRIVES.info TOOL RAM:Temp");
  386.     Execute(temp,NULL,NULL);
  387.    }
  388.    fo=fopen("Ram:Temp","w");
  389.    fprintf(fo,"START.300=0\n");
  390.    fprintf(fo,"END.300=2359\n");
  391.    fprintf(fo,"START.1200=0\n");
  392.    fprintf(fo,"END.1200=2359\n");
  393.    fprintf(fo,"START.2400=0\n");
  394.    fprintf(fo,"END.2400=2359\n");
  395.    fprintf(fo,"START.4800=0\n");
  396.    fprintf(fo,"END.4800=2359\n");
  397.    fprintf(fo,"START.7200=0\n");
  398.    fprintf(fo,"END.7200=2359\n");
  399.    fprintf(fo,"START.9600=0\n");
  400.    fprintf(fo,"END.9600=2359\n");
  401.    fprintf(fo,"START.14400=0\n");
  402.    fprintf(fo,"END.14400=2359\n");
  403.    fprintf(fo,"START.16800=0\n");
  404.    fprintf(fo,"END.16800=2359\n");
  405.    fprintf(fo,"START.19200=0\n");
  406.    fprintf(fo,"END.19200=2359\n");
  407.    fclose(fo);
  408.    i=0; while(i<nodes)
  409.    {
  410.      sprintf(temp,"AE3.0_Disk1:Utils/NewObj AE3.0_Disk1:Storage/Icons/TIMES.DEF.info BBS:Node%d/TIMES.DEF.info TOOL Ram:Temp",i++);
  411.      Execute(temp,NULL,NULL);
  412.    }
  413.    
  414. }
  415. void GetStr(char *d,char *s,int num)
  416. {
  417.    register int i=0;
  418.    while(num)
  419.    {
  420.      if(*(s+i)==' ') { num--;}
  421.      i++;
  422.    }
  423.    strcpy(d,&s[i]);
  424.    i=0;
  425.    while(*(d+i)!=' ' && *(d+i)!='\0') i++;
  426.    *(d+i)='\0';
  427. }
  428. void MakeIcons(void)
  429. {
  430.    FILE *fi,*fo;
  431.    char image[200];
  432.    char IconName[200];
  433.    char IconType[200];
  434.    char DestName[200];
  435.    char ToolType[200];
  436.    char TempName[200];
  437.    char Command[200];
  438.    char Type[200];
  439.    int old=0;
  440.    fi=fopen("RAM:ACP.SRT","r");
  441.    fo=fopen("RAM:temp","w");
  442.    strcpy(DestName,""); strcpy(TempName,"");
  443.    while(fgets(image,80,fi)!=NULL)
  444.    {
  445.       sr(image);
  446.       GetStr(IconName,image,0);
  447.       GetStr(IconType,image,1);
  448.       GetStr(DestName,image,2);
  449.       GetStr(ToolType,image,3);
  450.       if(old && strcmp(TempName,DestName))
  451.       {
  452.         fclose(fo);
  453.         Execute(Command,NULL,NULL);
  454.         fo=fopen("RAM:temp","w");
  455.  
  456.       }
  457.       switch(IconType[0])
  458.       {
  459.          case 'D': strcpy(Type,"DRAWER"); break;
  460.          case 'T': strcpy(Type,"TOOL"); break;
  461.          case 'P': strcpy(Type,"PROJECT"); break;
  462.       }
  463.       sprintf(Command,"AE3.0_Disk1:Utils/NewObj AE3.0_Disk1:Storage/Icons/%s.info %s.info %s RAM:Temp",IconName,DestName,Type);
  464.       fprintf(fo,"%s\n",ToolType);
  465.       strcpy(TempName,DestName);
  466.       old=1;
  467.    }
  468.    fclose(fi);
  469.    fclose(fo);
  470.    Execute(Command,NULL,NULL);
  471. }
  472. void ReadStartUp(void)
  473. {
  474.   FILE *fi,*fo;
  475.   char image[200];
  476.   char im2[200];
  477.   register int i;
  478.  
  479.   int Backup=1;
  480.   int Restrict=1;
  481.   int j;
  482.   fi=fopen("s:acp.startup","r");
  483.   fo=fopen("ram:acp.convert","w");
  484.   if(fi==NULL)
  485.   {
  486.     return;
  487.   }
  488.   fprintf(fo,"ACP.DEF T AE3.0_Disk1:WbStartup/ACP DONOTWAIT\n");
  489.   fprintf(fo,"ACP.DEF T AE3.0_Disk1:WbStartup/ACP MULTICOM_PORT\n");
  490.   while(fgets(image,80,fi)!=NULL)
  491.   {
  492.     sr(image);
  493.     if(!strnicmp(image,"NUMBER_OF_NODES",15))
  494.     {
  495.        nodes=atoileft(&image[15]);
  496. fprintf(fo,"ACP.DEF T AE3.0_Disk1:Wbstartup/ACP NODES=%d\n",nodes);
  497.      
  498.       continue;
  499.     }
  500.     if(CheckConfigNode(image,fo)) continue;
  501.     if(!strcmp(image,"ICONIFY"))
  502.     {
  503.       fprintf(fo,"ACP.DEF T AE3.0_Disk1:Wbstartup/ACP ICONIFIED\n"); continue; }
  504.     if(!strnicmp(image,"ITop",4))
  505.     {
  506.       j=atoileft(&image[4]);
  507.       fprintf(fo,"ACP.DEF T AE3.0_Disk1:Wbstartup/ACP ICONIFY.TOPEDGE=%d\n",j);
  508.       continue;
  509.     }
  510.     /*
  511.     if(!strnicmp(image,"BACKUP",6))
  512.     {
  513.       
  514.        strleft(im2,&image[6]);
  515.       
  516.        fprintf(fo,"ACP.DEF T AE3.0_Disk1:Wbstartup/ACP BACKUP.%d=%s\n",Backup,im2); Backup++;
  517.        continue;
  518.     }
  519.     if(!strnicmp(image,"RESTRICT",8))
  520.     {
  521.        strleft(im2,&image[8]);
  522.        fprintf(fo,"ACP.DEF T AE3.0_Disk1:Wbstartup/ACP RESTRICT.%d=%s\n",Restrict,im2); Restrict++;
  523.        continue;
  524.     }
  525.     */
  526.     if(!strnicmp(image,"ILeft",5))
  527.     {
  528.      
  529.       j=atoileft(&image[5]);
  530.        fprintf(fo,"ACP.DEF T AE3.0_Disk1:Wbstartup/ACP ICONIFY.LEFTEDGE=%d\n",j);
  531.       continue;
  532.     }
  533.   }
  534.   fclose(fi);
  535.     i=0; while(i<nodes)
  536.    {
  537.      fprintf(fo,"DRAWER D BBS:Node%d NODESTART=BBS:EXPRESS\n",i);
  538.      sprintf(image,"Copy >nil: AE3.0_Disk1:Storage/NewNode/Serial#? to BBS:Node%d ALL\n",i);
  539.      Execute(image,NULL,NULL);
  540.      sprintf(image,"Copy >nil: AE3.0_Disk1:Storage/NewNode/Modem#? to BBS:Node%d ALL\n",i);
  541.      Execute(image,NULL,NULL);
  542.      sprintf(image,"Copy >nil: AE3.0_Disk1:Storage/NewNode/Nrams#? to BBS:Node%d ALL\n",i);
  543.      Execute(image,NULL,NULL);
  544.      i++;
  545.    }
  546.  
  547. fclose(fo);
  548.   }
  549.  
  550. int CheckConfigNode(char str[],FILE *fo)
  551. {
  552.   register int i;
  553.   struct PSTR p;
  554.   char temp2[200];
  555.   if(ParseImage(str,&p))
  556.   {
  557.     if(!strnicmp(&str[p.s1],"LEFTEDGE",8)) 
  558.     { CMDLOOP  fprintf(fo,"WINDOW.DEF P BBS:Node%d/WINDOW.DEF WINDOW.LEFTEDGE=%d\n",i,atoi(&str[p.s2])); return(1); }
  559.     if(!strnicmp(&str[p.s1],"TOPEDGE",7)) 
  560.     { CMDLOOP  fprintf(fo,"WINDOW.DEF P BBS:Node%d/WINDOW.DEF WINDOW.TOPEDGE=%d\n",i,atoi(&str[p.s2])); return(1); }
  561.     if(!strnicmp(&str[p.s1],"WIDTH",5)) 
  562.     { CMDLOOP  fprintf(fo,"WINDOW.DEF P BBS:Node%d/WINDOW.DEF WINDOW.WIDTH=%d\n",i,atoi(&str[p.s2])); return(1); }
  563.     if(!strnicmp(&str[p.s1],"HEIGHT",6)) 
  564.     { CMDLOOP  fprintf(fo,"WINDOW.DEF P BBS:Node%d/WINDOW.DEF WINDOW.HEIGHT=%d\n",i,atoi(&str[p.s2])); return(1); }
  565.     if(!strnicmp(&str[p.s1],"BITPLANES",9)) 
  566.     { CMDLOOP  fprintf(fo,"WINDOW.DEF P BBS:Node%d/WINDOW.DEF WINDOW.NUM_COLORS=8\n",i); return(1); }
  567.     if(!strnicmp(&str[p.s1],"LOGOFFBATCH",11)) 
  568.     { CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d BATCH.LOGOFF=%s\n",i,&str[p.s2]); return(1); }
  569.     if(!strnicmp(&str[p.s1],"SHUTDOWN_BATCH",14)) 
  570.     { CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d BATCH.SHUTDOWN=%s\n",i,&str[p.s2]); return(1); }
  571.     if(!strnicmp(&str[p.s1],"STATBAR",7))
  572.     {
  573.       CMDLOOP  fprintf(fo,"WINDOW.DEF P BBS:Node%d/WINDOW.DEF WINDOW.STATBAR\n",i);return(1);
  574.     }
  575.     if(!strnicmp(&str[p.s1],"INTERLACE",9))
  576.     {
  577.       CMDLOOP  fprintf(fo,"WINDOW.DEF P BBS:Node%d/WINDOW.DEF WINDOW.INTERLACE\n",i); return(1);
  578.     }
  579.     if(!strnicmp(&str[p.s1],"DUPE_FILECHECK",14))
  580.     {
  581.       fprintf(fo,"DRAWER D BBS:ACCESS ACS.DUPE_FILECHECK\n"); return(1);
  582.     }
  583.     if(!strnicmp(&str[p.s1],"SUPPRESS_QLOGON",15))
  584.     {
  585.       CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d DISABLE_QUICK_LOGONS\n",i); return(1);
  586.     }
  587.      if(!strnicmp(&str[p.s1],"RELATIVE_CONFERENCES",20))
  588.      {
  589.        fprintf(fo,"CONF.DEF P BBS:CONFCONFIG RELATIVE_CONFERENCES\n"); return(1); }
  590.      if(!strnicmp(&str[p.s1],"DOORLOG",7))
  591.      {
  592.        CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d DOOR_LOG\n",i); return(1); }
  593.      if(!strnicmp(&str[p.s1],"STARTLOG",8))
  594.      {
  595.        CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d START_LOG\n",i); return(1); }
  596.      if(!strnicmp(&str[p.s1],"NO_TIMEOUT",10))
  597.      {
  598.        CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d NO_TIMEOUT\n",i); return(1); }
  599.      if(!strnicmp(&str[p.s1],"NO_MCI_MESSAGE",14))
  600.      {
  601.        CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d NO_MCI_MSG\n",i);return(1); }
  602.      if(!strnicmp(&str[p.s1],"BREAK_CHAT",10))
  603.      {
  604.        CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d BREAK_CHAT\n",i); return(1); }
  605.      if(!strnicmp(&str[p.s1],"QUIETNODE",9))
  606.      {
  607.        CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d QUIETNODE\n",i); return(1); }
  608.     if(!strnicmp(&str[p.s1],"SENTBY_FILES",12))         
  609.     { CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d SENTBY_FILES\n",i);return(1); }
  610.     if(!strnicmp(&str[p.s1],"DEFAULT_CHAT_ON",15))      
  611.     { CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d CHAT_ON\n",i); return(1); }
  612.     if(!strnicmp(&str[p.s1],"CAPITOLS_in_FILE",16))     
  613.     { CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d CAPITOL_FILES\n",i); return(1); }
  614.     if(!strnicmp(&str[p.s1],"CHAT_COLOR_SYSOP",16))     
  615.     { CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d SYSOP_CHAT_COLOR=%d\n",i,atoi(&str[p.s2])); return(1); }
  616.     if(!strnicmp(&str[p.s1],"CHAT_COLOR_USER",15))      
  617.     { CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d USER_CHAT_COLOR=%d\n",i,atoi(&str[p.s2])); return(1); }
  618.     if(!strnicmp(&str[p.s1],"KEEP_UPLOAD_CREDIT",18))   
  619.     { CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d KEEP_UPLOAD_CREDIT=1\n",i); return(1); }
  620.     if(!strnicmp(&str[p.s1],"ALLOW_FREE_RESUMING",19))  
  621.     { CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d FREE_RESUMING\n",i); return(1); }
  622.     if(!strnicmp(&str[p.s1],"DO_CALLERSLOG",13))        
  623.     { CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d CALLERS_LOG\n",i); return(1); }
  624.     if(!strnicmp(&str[p.s1],"DO_U/D_LOG",10))          
  625.     { CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d UD_LOG\n",i); return(1); }
  626.     if(!strnicmp(&str[p.s1],"CONF_NAME",9))
  627.     {
  628.          fprintf(fo,"CONF.DEF P BBS:CONFCONFIG NAME.%d=%s\n",atoi(&str[p.s2]),&str[p.s2+3]);
  629.                  return(1);
  630.     }
  631.     if(!strnicmp(&str[p.s1],"CONF_LOCAL",10))
  632.     {
  633.          fprintf(fo,"CONF.DEF P BBS:CONFCONFIG LOCATION.%d=%s\n",atoi(&str[p.s2]),&str[p.s2+3]);
  634.                  return(1);
  635.     }
  636.     if(!strnicmp(&str[p.s1],"SYSTEM_PASSWORD",15))                 
  637.     { CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d SYSTEM_PASSWORD=%s\n",i,&str[p.s2]); return(1); }
  638.     if(!strnicmp(&str[p.s1],"REMOTE_PASSWORD",15))                 
  639.     { CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d REMOTE_PASSWORD=%s\n",i,&str[p.s2]); return(1); }
  640.     if(!strnicmp(&str[p.s1],"NEW_USER_PASSWORD",17))                 
  641.     { CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d NEWUSER_PASSWORD=%s\n",i,&str[p.s2]); return(1); }
  642.     if(!strnicmp(&str[p.s1],"TASK_PRIORITY",13))                 
  643.     { CMDLOOP  fprintf(fo,"DRAWER D BBS:Node%d PRIORITY=%d\n",i,atoi(&str[p.s2])); return(1); }
  644.     if(!strnicmp(&str[p.s1],"BBS_NAME",8))                 
  645.     { 
  646.        fprintf(fo,"ACP.DEF T AE3.0_Disk1:Wbstartup/ACP BBS_NAME=%s\n",&str[p.s2]); return(1); }
  647.     if(!strnicmp(&str[p.s1],"BBS_LOCATION",12))                 
  648.     {  fprintf(fo,"ACP.DEF T AE3.0_Disk1:Wbstartup/ACP BBS_LOCATION=%s\n",&str[p.s2]); return(1); }
  649.     if(!strnicmp(&str[p.s1],"SYSOP_NAME",10))                 
  650.     {  fprintf(fo,"ACP.DEF T AE3.0_Disk1:Wbstartup/ACP SYSOP_NAME=%s\n",&str[p.s2]); return(1); }
  651.     if(!strnicmp(&str[p.s1],"TOTAL_CONFERENCES",17))
  652.     {  fprintf(fo,"CONF.DEF P BBS:CONFCONFIG NCONFS=%d\n",atoi(&str[p.s2])); return(1); }
  653.      
  654.  
  655.   }
  656.   return(0);
  657. }
  658.       
  659.   
  660. void sr(char *str)
  661. {
  662.   register int i;
  663.   i=strlen(str)-1;
  664.   while(i)
  665.   {
  666.     if(*(str+i)<=32) *(str+i)='\0'; else break;
  667.     i--;
  668.   }
  669. }
  670.  
  671. int ParseImage(char *str,struct PSTR *p)
  672. {
  673.   register int i;
  674.   int returncode=0;
  675.   if(!strnicmp(str,"Node",4))
  676.   {
  677.     if(*(str+4)=='*') { p->ns=0;p->ne=nodes-1; }
  678.     else { p->ns=(*(str+4))-'0';p->ne=p->ns; } 
  679.     returncode=1;
  680.     i=5;
  681.     p->s2=0;
  682.     p->s1=0;
  683.     while(*(str+i)!='\0')
  684.     {
  685.       if(*(str+i)!=' ')
  686.       { 
  687.           p->s1=i; break;
  688.       }
  689.       i++;
  690.     }
  691.     while(*(str+i)!='\0')
  692.     {
  693.       if(*(str+i)==' ') break;
  694.       i++;
  695.     }
  696.     while(*(str+i)!='\0')
  697.     {
  698.       if(*(str+i)!=' ')
  699.       {
  700.         p->s2=i; break;
  701.       }
  702.       i++;
  703.     }
  704.   }
  705.     return(returncode);
  706. }
  707. void strleft(char *str,char *str1)
  708. {
  709.    register int i=0,j=0;
  710.    while(*(str1+i)==' ') i++;
  711.    while(*(str1+i)!='\0'){ *(str+j)=*(str1+i); i++; j++; }
  712.    *(str+j)='\0';
  713. }
  714. int atoileft(char str[])
  715. {
  716.   register int i=0;
  717.   while(str[i]==' ') i++;
  718.   return(atoi(&str[i]));
  719. }
  720.